from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

Base = declarative_base()
engine = create_engine('sqlite:///database.db', echo=True)

class User(Base):
	__tablename__ = 'users'

	id = Column(Integer,primary_key=True)
	name=Column(String)
	fullname = Column(String)
	password = Column(String)

Base.metadata.create_all(engine)

if __name__ == '__main__':
	# print(User.__table__)

	Session = sessionmaker(bind=engine)
	session = Session()

	ed_user = User(name='ed', fullname='Ed Jones', password='edspassword')
	session.add(ed_user)
	session.commit()
	# print(session.dirty)

	one = session.query(User,User.password).first()
	print(one.password)